$(function(){
    //定义左边菜单栏组件
    var  personalMenuComponent = {
        data: function(){
            return {
                mobile:$.cookie('mobile'),
                sMobile: $.cookie('mobile')? $.cookie('mobile').substr(0,3)+'****'+$.cookie('mobile').substr(-4):"",
                registerDate:$.cookie('registerDate'),
            };
        },
        props:['isOne','isTwo','isThree'],
        methods:{
            toLogin:function(){
                location.href = 'login.html';
            },
            //左边菜单
            toMyPage:function(event){
                var value = parseInt(event.currentTarget.value);
                $('.my-box').addClass('hidden'); //隐藏右边内容
                $('.nav-item').removeClass('nav-active').find('img').removeClass('hidden'); //导航颜色
                switch(value){
                    case 1:
                        $('.price-box').removeClass('hidden');
                        $('.nav-item').eq(value-1).addClass('nav-active').find('img').addClass('hidden');
                        location.href = 'personal.html';
                        break;
                    case 2:
                        $('.attention-box').removeClass('hidden');
                        $('.nav-item').eq(value-1).addClass('nav-active').find('img').addClass('hidden');
                        location.href = 'personalAttention.html';
                        break;
                    case 3:
                        $('.int-box').removeClass('hidden');
                        $('.nav-item').eq(value-1).addClass('nav-active').find('img').addClass('hidden');
                        location.href = 'personalInt.html';
                        break;
                }
            },
        },
        mounted:function(){
            if(isLogin()){
                showLeftMenu(true);
            }else{
                showLeftMenu(false);
            }
        },
        template:'  <div>\n' +
            '            <div class="my-profile">\n' +
            '                <div class="my-icon"><img src="image/zhongxin.png"></div>\n' +
            '                <div class="my-phone  hidden">{{sMobile}}</div>\n' +
            '                <div class="my-reg-time  hidden">注册时间：<span>{{registerDate}}</span></div>\n' +
            '                <div class="my-status">您还没有登录</div>\n' +
            '                <div class="my-login pointer" @click="toLogin">去登录</div>\n' +
            '            </div>\n' +
            '            <ul class="my-nav">\n' +
            '                <li class="nav-item" :class="{\'nav-active\':isOne}" @click="toMyPage" value="1"><span>我的资产</span><img src="image/jinru.png" :class="{hidden: isOne}"></li>\n' +
            '                <li class="nav-item" :class="{\'nav-active\':isTwo}" @click="toMyPage" value="2"><span>我的关注</span><img src="image/jinru.png" :class="{hidden: isTwo}"></li>\n' +
            '                <li class="nav-item" :class="{\'nav-active\':isThree}" @click="toMyPage" value="3"><span>我的积分</span><img src="image/jinru.png" :class="{hidden: isThree}"></li>\n' +
            '            </ul>\n' +
            '        </div>',
    };


    //大图Modal
    if(document.getElementById('largeImgModal')){
        var largeImg = new Vue({
            el:"#largeImgModal",
            data:{
                imgUrl : "",
                index: "",
                imgIndex:"",
            },
            methods:{
                nextImg:function(){
                    var count = blogInfo.blogBlock[this.index].largeUrls.length;

                    if(parseInt(this.imgIndex)+1 >= count){
                        this.imgIndex = 0;
                    }else{
                        this.imgIndex ++;
                    }

                    // this.setLargeImgSize(blogInfo,this.index,this.imgIndex);
                    this.imgUrl = blogInfo.blogBlock[this.index].largeUrls[this.imgIndex];
                },
                prevImg:function(){
                    var count = blogInfo.blogBlock[this.index].largeUrls.length;
                    if(parseInt(this.imgIndex)- 1 < 0){
                        this.imgIndex = count-1;
                    }else{
                        this.imgIndex --;
                    }
                    // this.setLargeImgSize(blogInfo,this.index,this.imgIndex);
                    this.imgUrl = blogInfo.blogBlock[this.index].largeUrls[this.imgIndex];
                },
                btnIn:function(type){
                    switch(parseInt(type)){
                        case 0:
                            // $('#largeImgModal .right-btn').css({'color':'rgba(255,255,255,1)'});
                            $('#largeImgModal .right-btn img').attr('src','image/largeRightActive.png');
                            break;
                        case 1:
                            // $('#largeImgModal .left-btn').css({'color':'rgba(255,255,255,1)'});
                            $('#largeImgModal .left-btn img').attr('src','image/largeLeftActive.png');
                            break;
                        case 2:
                            $('#largeImgModal .close-btn img').attr('src','image/largeCloseActive.png');
                            break;
                    }
                },
                btnOut: function(type){
                    switch(parseInt(type)){
                        case 0:
                            $('#largeImgModal .right-btn img').attr('src','image/largeRight.png');
                            break;
                        case 1:
                            $('#largeImgModal .left-btn img').attr('src','image/largeLeft.png');
                            break;
                        case 2:
                            $('#largeImgModal .close-btn img').attr('src','image/largeClose.png');
                            break;
                    }
                }
            },

        });
    }

    //饼图参数
    var pieOption = {
        center: ['50%', '50%'],
        color: ['#F9C5A9', '#D0B8E9','#EEBDC7','#EDE29D','#A6DEBC','#90DBDB','#D7E7BA','#BAD0EF','#E3D2C1'],
        series: [
            {
                name:'总资产',
                type:'pie',
                radius: ['70%', '100%'],
                avoidLabelOverlap: false,
                hoverAnimation:false, //悬停变大
                legendHoverLink:false,
                label: {
                    normal: {
                        show: false,
                        position: 'center'
                    },
                    emphasis: {
                        show: false, //悬停显示data标签
                        textStyle: {
                            fontSize: '30',
                            fontWeight: 'bold'
                        }
                    }
                },
                labelLine: {
                    normal: {
                        show: false,
                        selectedMode:false
                    }
                },
                itemStyle: { // 此配置
                    normal: {
                        borderWidth: 2,
                        borderColor: '#ffffff',
                    },
                },
                data:[
                    {value:335, name:'BTC'},
                    {value:310, name:'XRR'},
                    {value:234, name:'ETH'},
                    {value:135, name:'OXX'},
                    {value:540, name:'ECO'},
                    {value:200, name:'OTO'},
                    {value:25, name:'OTO'},
                    {value:157, name:'OTO'},
                    {value:336, name:'OTO'},

                ],
            }
        ]
    };

    //我的左边菜单
    if(document.getElementById('my-info')){
        var my = new Vue({
            el:"#my-info",
            components:{
                'personal-menu-content': personalMenuComponent,
            },
            // data:{
            //     mobile:$.cookie('mobile'),
            //     sMobile: $.cookie('mobile')? $.cookie('mobile').substr(0,3)+'****'+$.cookie('mobile').substr(-4):"",
            //     registerDate:$.cookie('registerDate'),
            // },
            // methods:{
            //     toLogin:function(){
            //         location.href = 'login.html';
            //     },
            //     //左边菜单
            //     toMyPage:function(event){
            //         var value = parseInt(event.currentTarget.value);
            //         $('.my-box').addClass('hidden'); //隐藏右边内容
            //         $('.nav-item').removeClass('nav-active').find('img').removeClass('hidden'); //导航颜色
            //         switch(value){
            //             case 1:
            //                 $('.price-box').removeClass('hidden');
            //                 $('.nav-item').eq(value-1).addClass('nav-active').find('img').addClass('hidden');
            //                 location.href = 'personal.html';
            //                 break;
            //             case 2:
            //                 $('.attention-box').removeClass('hidden');
            //                 $('.nav-item').eq(value-1).addClass('nav-active').find('img').addClass('hidden');
            //                 location.href = 'personalAttention.html';
            //                 break;
            //             case 3:
            //                 $('.int-box').removeClass('hidden');
            //                 $('.nav-item').eq(value-1).addClass('nav-active').find('img').addClass('hidden');
            //                 location.href = 'personalInt.html';
            //                 break;
            //         }
            //     },
            // },
            // mounted:function(){
            //     if(isLogin()){
            //         showLeftMenu(true);
            //     }else{
            //         showLeftMenu(false);
            //     }
            // }
        });
    }


    //我的资产详细信息
    if(document.getElementById('my-price-block')){
        var myInfo = new Vue({
            el: '#my-price-block',
            data:{
                // totalPriceCny: "3,234,123.00", //总资产 饼图用
                // totalPriceUsd:"44883.80",  //
                capitalUsd: "", //	投入本金	String	是	交易记录表中，场外交易 买入总和- 卖出总和
                capitalCny: "", //	投入本金	String	是	交易记录表中，场外交易 买入总和- 卖出总和
                sumProfitAmtUsd: "", //	累计收益	Number	是	估值-本金
                sumProfitAmtCny: "", //	累计收益	Number	是	估值-本金
                totalPriceUsd: 0, //	资产估值	Number	是	每个币种数量 * 单价，加和
                totalPriceCny: 0, //	资产估值	Number	是	每个币种数量 * 单价，加和
                mobile: "", //	登录账号	String	是
                registerDate:  "", //	注册时间	Number	是
                //走势图选项
                // trendOption: trendOption,
                //饼图选项
                pieOption: pieOption,
                // color:["#d0b8e8","#f0bcc9","#ece29d","#a6debb","#90dbde","#bbd0ef"],
                color:['#F9C5A9', '#D0B8E9','#EEBDC7','#EDE29D','#A6DEBC','#90DBDB','#D7E7BA','#BAD0EF','#E3D2C1'],
                pieList:[],//饼图数据
                list:[], //货币列表

                isShow: true, //显示标志
                capitalUsdBack: "", //	投入本金	String	是	交易记录表中，场外交易 买入总和- 卖出总和
                capitalCnyBack: "", //	投入本金	String	是	交易记录表中，场外交易 买入总和- 卖出总和
                sumProfitAmtUsdBack: "", //	累计收益	Number	是	估值-本金
                sumProfitAmtCnyBack: "", //	累计收益	Number	是	估值-本金
                totalPriceUsdBack: 0, //	资产估值	Number	是	每个币种数量 * 单价，加和
                totalPriceCnyBack: 0, //	资产估值	Number	是	每个币种数量 * 单价，加和

            },
            methods:{
                //显示帮助信息
                showHelpMsg:function(){
                    var title = event.currentTarget.getAttribute('value');
                    $('.help-msg').text(title).removeClass('hidden');
                },
                //隐藏帮助信息
                hideHelpMsg:function(){
                    $('.help-msg').addClass('hidden');
                },
                toggleShow:function(){
                    if(this.isShow){
                        this.capitalUsd = "***";
                        this.capitalCny = "***";//	投入本金	String	是	交易记录表中，场外交易 买入总和- 卖出总和
                        this.sumProfitAmtUsd = "***"; //	累计收益	Number	是	估值-本金
                        this.sumProfitAmtCny = "***"; //	累计收益	Number	是	估值-本金
                        this.totalPriceUsd = "***";//	资产估值	Number	是	每个币种数量 * 单价，加和
                        this.totalPriceCny = "***"; //	资产估值	Number	是	每个币种数量 * 单价，加和
                        //
                        for(var i=0; i<this.pieList.length; i++){
                            this.pieList[i].flowNum = "***";
                            this.pieList[i].price = "***";
                            this.pieList[i].rate = '***';
                        }
                        for(var i=0; i<this.list.length; i++){
                            this.list[i].flowNum = "***";
                            this.list[i].price = "***";
                            this.list[i].rate = '***';
                        }
                        this.isShow = false;
                    }else{
                        this.capitalUsd = this.capitalUsdBack;
                        this.capitalCny = this.capitalCnyBack;//	投入本金	String	是	交易记录表中，场外交易 买入总和- 卖出总和
                        this.sumProfitAmtUsd = this.sumProfitAmtUsdBack; //	累计收益	Number	是	估值-本金
                        this.sumProfitAmtCny = this.sumProfitAmtCnyBack; //	累计收益	Number	是	估值-本金
                        this.totalPriceUsd = this.totalPriceUsdBack;//	资产估值	Number	是	每个币种数量 * 单价，加和
                        this.totalPriceCny = this.totalPriceCnyBack; //	资产估值	Number	是	每个币种数量 * 单价，加和

                        for(var i=0; i<this.pieList.length; i++){
                            this.pieList[i].flowNum = this.pieList[i].flowNumBack;
                            this.pieList[i].price = this.pieList[i].priceBack;
                            this.pieList[i].rate = this.pieList[i].rateBack;
                        }
                        for(var i=0; i<this.list.length; i++){
                            this.list[i].flowNum = this.list[i].flowNumBack;
                            this.list[i].price = this.list[i].priceBack;
                            this.list[i].rate = this.list[i].rateBack;
                        }
                        this.isShow = true;
                    }
                },
                drawPie:function(){
                    // 饼图
                    var myPie = echarts.init(document.getElementById('pie-img'));
                    // 使用刚指定的配置项和数据显示图表。
                    myPie.setOption(this.pieOption);
                },
                //设置货币提醒
                setWarn:function(event){

                    currencyWarn.list = [];
                    var id = event.currentTarget.getAttribute('value');
                    var data = {
                        coinId:id,
                        element: currencyWarn,
                    };
                    getCoinProfileWarn(data);
                    var flag = event.currentTarget.getAttribute('flag');
                    var left = ($(window).width()- 500)/2;
                    var top = ($(window).height()- 556)/2;
                    $('.warn-btn').removeClass('btn-active');
                    $('#warnCurrencyModal').modal('show').css({
                        'margin-top':top,
                        'margin-left':left,
                        'width':500,
                        'height':556,
                    });
                    currencyWarn.upNum = "";
                    currencyWarn.downNum = "";
                    if(flag == 1 ){ //0 未设置提醒  1 已设置提醒
                        //调用接口
                        var obj = {
                            remindingType: 0, //	提醒类型	否	1	Number	为空查询所有，0查询币种提醒，1 查询资产提醒
                            coinId: id, // 	币种	否	30	String   remindingType为0时，必填
                            pageSize: 10, //	每页条数	否	3	Number	默认10
                            pageNum: 1, //	第几页	否	3	Number	默认第一页
                            element: currencyWarn,
                        };
                        getRemindingsList(obj);
                    }

                },
                toLogin:function(){
                    location.href = 'login.html';
                },
                //设置资产提醒
                setPriceWarn:function(){
                    warn.usd = this.totalPriceUsd;
                    warn.cny = this.totalPriceCny;
                    var left = ($(window).width()- 500)/2;
                    var top = ($(window).height()- 556)/2;
                    $('#warnPriceModal').modal('show').css({
                        'margin-top':top,
                        'margin-left':left,
                        'width':500,
                        'height':556,
                    });

                    priceWarn.usd = this.totalPriceUsd;
                    priceWarn.cny = this.totalPriceCny;
                    //调用接口
                    var obj = {
                        remindingType: 1, //	提醒类型	否	1	Number	为空查询所有，0查询币种提醒，1 查询资产提醒
                        pageSize: 10, //	每页条数	否	3	Number	默认10
                        pageNum: 1, //	第几页	否	3	Number	默认第一页
                        element: priceWarn,
                    };
                    getRemindingsList(obj);
                },
                //记一笔
                setRecord:function(){
                    // warn.usd = this.totalPriceUsd;
                    // warn.cny = this.totalPriceCny;
                    var left = ($(window).width()- 500)/2;
                    var top = ($(window).height()- 534)/2;
                    $('#recordModal').modal('show').css({
                        'margin-top':top,
                        'margin-left':left,
                        'width':500,
                        'height':534,
                    });
                },
                //交易记录
                toRecord: function(){
                    location.href = "personalRecord.html";
                },
                //提醒记录
                toWarn: function(){
                    location.href = "personalWarn.html";
                },
                //设置饼图说明行数
                setPieList: function(){
                    switch(this.list.length){
                        case 1:
                        case 2:
                            $('#pie-list').css({'margin-top':86});
                            break;
                        case 3:
                        case 4:
                            $('#pie-list').css({'margin-top':66});
                            break;
                        case 5:
                        case 6:
                            $('#pie-list').css({'margin-top':46});
                            break;
                        case 7:
                        case 8:
                            $('#pie-list').css({'margin-top':20});
                            break;
                        case 9:
                        case 10:
                            $('#pie-list').css({'margin-top':0});
                            break;

                    }
                }

            },
            mounted: function(){
                this.$nextTick(function(){
                    if(isLogin()){
                        $('.my-price').removeClass('hidden');
                        // $('.my-pie').removeClass('hidden');
                        $('.login-table').removeClass('hidden');

                        $('.no-login-box').addClass('hidden');
                        $('.no-login-table').addClass('hidden');

                        // showLeftMenu(true);
                    }else{
                        $('.my-price').addClass('hidden');
                        $('.my-pie').addClass('hidden');
                        $('.login-table').addClass('hidden');
                        $('.no-login-box').removeClass('hidden');
                        $('.no-login-table').removeClass('hidden');

                        // showLeftMenu(false);
                        this.pieOption.series[0].data =[{value:100, name:'no'}];
                        this.pieOption.series[0].color =['rgba(238,238,238,1)'];
                        this.pieOption.series[0].itemStyle.normal.borderWidth  = 0;

                    }
                    this.drawPie();
                    this.setPieList();

                    var obj ={element: myInfo,element2:my};
                    getAsset(obj);  //查询我的资产信息
                });
            },
        });
    }

    // 资讯导航信息
    if(document.getElementById('information-nav')){
        var followHeader = new Vue({
            el:'#information-nav',
            data:{
                currType: 1, // 1:24H资讯  4：精选资讯   2: 微博   3: Twitter  5: 技术资讯
                totalNumList:[0,0,0,0,0,0] ,//每项文章的数LIST  1:24H资讯  4：精选资讯   2: 微博   3: Twitter  5: 技术资讯
                followList:[],
            },
            methods:{
                hightShow: function(type,event){
                    switch(type){
                        case 0:
                            event.currentTarget.setAttribute('src','image/zuoActive.png');
                            break;
                        case 1:
                            event.currentTarget.setAttribute('src','image/youActive.png');
                            break;
                    }

                },
                remHightShow: function(type,event){
                    switch(type){
                        case 0:
                            event.currentTarget.setAttribute('src','image/zuo.png');
                            break;
                        case 1:
                            event.currentTarget.setAttribute('src','image/you.png');
                            break;
                    }

                },
                //切换菜单时，头像切换
                changeHeader:function(obj){
                    var man = {};
                    this.followList = [];

                    console.log(obj.followList);
                    for(var i=0; i<obj.followList.length; i++) {
                        man.username = obj.followList[i].username;  //	来源名称	String	是	三方平台作者名称
                        man.id = obj.followList[i].id; //	来源ID	String	是	三方平台作者Id
                        man.userImg = obj.followList[i].userImg; //	来源头像图片	String	否	三方平台作者头像

                        Vue.set(this.followList, this.followList.length, man);
                        man = {};
                    }

                },
                // 切换资讯标签
                changeNews: function(type,event){
                    //导航颜色
                    $('.news-nav').removeClass('nav-active');
                    $(event.currentTarget).addClass('nav-active');
                    //搜索按钮颜色，变成 全部
                    $('.filtrate-btn').removeClass('btn-active').eq(0).addClass('btn-active');
                    //右侧栏目显示
                    $('#news-information .box').removeClass('hidden');
                    //显示内容模块
                    type = parseInt(type);

                    $('.news-box').addClass('hidden');
                    if(isLogin()){
                        this.currType = type;
                        this.followList = [];
                        $('.loadData').removeClass('hidden');
                        $('.noData').addClass('hidden');
                        switch(type){
                            case 1:
                                cancelLoad([siftInfo.loadData,twitterInfo.loadData,blogInfo.loadData,skillInfo.loadData]);
                                addLoad(quickInfo.loadData);
                                $('#quick-information').removeClass('hidden');
                                break;
                            case 4:
                                cancelLoad([siftInfo.loadData,twitterInfo.loadData,blogInfo.loadData,skillInfo.loadData]);
                                addLoad(siftInfo.loadData);
                                $('.hot-box').addClass('hidden');
                                $('#sift-information').removeClass('hidden');

                                if(isLogin() ){
                                    siftInfo.siftBlock = [];
                                    var obj = {
                                        infoType: 4, //	资讯类型	是	2	Number	4 精选资讯 5 技术分析
                                        pageSize: siftInfo.pageSize, //	每页条数	否	9	Number	默认10，最大50
                                        pageNum: siftInfo.currPage, //	第几页	否	9	Number	默认1
                                        element: siftInfo,
                                        element2:followHeader,
                                    };
                                    getFollowAiticlesList(obj);
                                }
                                break;
                            case 2:
                                cancelLoad([blogInfo.loadData,siftInfo.loadData,twitterInfo.loadData,skillInfo.loadData]);
                                addLoad(blogInfo.loadData);
                                $('.hot-box').addClass('hidden');
                                $('.ranking-box').addClass('hidden');
                                $('#blog-information').removeClass('hidden');

                                if(isLogin() ){
                                    blogInfo.blogBlock = [];
                                    var obj = {
                                        infoType: 2, //	资讯类型	是	2	Number	4 精选资讯 5 技术分析
                                        pageSize: blogInfo.pageSize, //	每页条数	否	9	Number	默认10，最大50
                                        pageNum: blogInfo.currPage, //	第几页	否	9	Number	默认1
                                        element: blogInfo,
                                        element2: followHeader,
                                    };
                                    getFollowDynamicList(obj);
                                }
                                break;
                            case 3:
                                cancelLoad([twitterInfo.loadData,siftInfo.loadData,blogInfo.loadData,skillInfo.loadData]);
                                addLoad(twitterInfo.loadData);
                                $('.hot-box').addClass('hidden');
                                $('.ranking-box').addClass('hidden');
                                $('#twitter-information').removeClass('hidden');

                                if(isLogin()){
                                    twitterInfo.twitterBlock = [];
                                    var obj = {
                                        infoType: 3, //	资讯类型	是	2	Number	4 精选资讯 5 技术分析
                                        pageSize: twitterInfo.pageSize, //	每页条数	否	9	Number	默认10，最大50
                                        pageNum: twitterInfo.currPage, //	第几页	否	9	Number	默认1
                                        element: twitterInfo,
                                        element2: followHeader,
                                    };
                                    getFollowDynamicList(obj);
                                }
                                break;
                            case 5:
                                cancelLoad([siftInfo.loadData,siftInfo.loadData,twitterInfo.loadData,blogInfo.loadData,]);
                                addLoad(skillInfo.loadData);
                                $('.hot-box').addClass('hidden');
                                $('.online-box').addClass('hidden');
                                $('#skill-information').removeClass('hidden');
                                if(isLogin()){
                                    skillInfo.skillBlock = [];
                                    var obj = {
                                        infoType: 5, //	资讯类型	是	2	Number	4 精选资讯 5 技术分析
                                        pageSize: skillInfo.pageSize, //	每页条数	否	9	Number	默认10，最大50
                                        pageNum: skillInfo.currPage, //	第几页	否	9	Number	默认1
                                        element: skillInfo,
                                        element2: followHeader,
                                    };
                                    getFollowAiticlesList(obj);
                                }
                                break;
                        }
                    }

                },
                //头像左右移动
                blockSilder: function(sign,$event){
                    // //设置头像左右移动头像box宽度
                    var itemWidth = $('#information-nav .item-info').eq(0).outerWidth(true); //获取每个item宽度
                    $('#information-nav .item-box').eq(0).width((parseFloat(itemWidth))*$('#information-nav .item-info').length);

                    var groupWidth = $('#information-nav .item-group').outerWidth();
                    var boxWidth = $('#information-nav .item-box').outerWidth(true);
                    var boxLeft = $('#information-nav .item-box').css('left');
                    if(sign == 'next'){
                        var left = parseFloat(boxLeft) - groupWidth;
                        if(Math.abs(left) <= boxWidth){
                            $('#information-nav .item-box').animate({left: left},400);
                        }
                    }else{
                        var left = parseFloat(boxLeft) + groupWidth;
                        if(left <=0){
                            $('#information-nav .item-box').animate({left: left},400);
                        }
                    }
                },
                //点击头像调用 个人主页
                goPersonalMain: function(event){
                    var type =  $('#information-list .nav-active').attr('type');
                    var id = event.currentTarget.getAttribute('value');
                    // location.href="personalMain.html?id="+id;
                    window.open("personalMain.html?id="+id+'&type='+type);
                }
            },
            mounted: function(){
                this.$nextTick(function(){
                    //判断当前用户状态，登录 | 未登录
                    if(isLogin()){
                        $('.attention-box .no-login').addClass('hidden');
                        $('.attention-box .news-nav-num').removeClass('hidden');
                        $('.attention-box .msg-list').removeClass('hidden');
                        $('.attention-box .information-box').removeClass('hidden');

                        $('#information-nav').css({'min-height':184});


                    }else{
                        $('.attention-box .no-login').removeClass('hidden');
                        $('.attention-box .news-nav-num').addClass('hidden');
                        $('.attention-box .msg-list').addClass('hidden');
                        $('.attention-box .information-box').addClass('hidden');

                        $('#information-nav').css({'min-height':566});
                    }
                });
            },
        });
    }


    //精选资讯
    if(document.getElementById('sift-information')){
        var siftInfo = new Vue({
            el: '#sift-information',
            data:{
                totalNum:0,
                currPage: 1,
                pageSize: 10,
                keyword: getUrlParams().content ? decodeURI(getUrlParams().content) : "",
                followList: [],
                siftBlock: [],
            },
            components:{
                'sift-content': siftComponent,
            },
            methods:{
                //加载数据
                loadData: function(){
                    // var sw = true;
                    if(getScrollTop() + window.innerHeight >= document.body.offsetHeight-50) {
                        if(this.totalNum > this.siftBlock.length) {
                            $('.loadData').removeClass('hidden');
                            var _this = this;
                            if (sw == true) {
                                sw = false;
                                var obj = {
                                    infoType: 4, //	资讯类型	是	2	Number	4 精选资讯 5 技术分析
                                    pageSize: this.pageSize, //	每页条数	否	9	Number	默认10，最大50
                                    pageNum: this.currPage, //	第几页	否	9	Number	默认1
                                    element: this,
                                    element2: followHeader, //头像列表对象
                                };
                                this.currPage++;
                                getFollowAiticlesList(obj);
                            }
                        }
                    }
                }, //结束 loadData,
            },
            mounted:function(){
                this.$nextTick(function(){
                    if(isLogin()){
                        addLoad(this.loadData);
                        var obj = {
                            infoType: 4, //	资讯类型	是	2	Number	4 精选资讯 5 技术分析
                            pageSize: siftInfo.pageSize, //	每页条数	否	9	Number	默认10，最大50
                            pageNum: siftInfo.currPage, //	第几页	否	9	Number	默认1
                            element: siftInfo,
                            element2:followHeader,
                        };
                        getFollowAiticlesList(obj);
                    }
                });
            }
        });
    }


    //twitter
    if(document.getElementById('sift-information')){
        var twitterInfo = new Vue({
            el: '#twitter-information',
            data:{
                currPage:1 ,
                pageSize: 10,
                totalNum: 0,
                followList: [],
                twitterBlock: [],
            },
            methods:{
                loadData:function(){
                    // var sw = true;
                    if(getScrollTop() + window.innerHeight >= document.body.offsetHeight-50) {
                        if(this.totalNum > this.twitterBlock.length) {
                            $('.loadData').removeClass('hidden');
                            var _this = this;
                            if (sw == true) {
                                sw = false;
                                var obj = {
                                    infoType: 3, //	资讯类型	是	2	Number	4 精选资讯 5 技术分析
                                    pageSize: this.pageSize, //	每页条数	否	9	Number	默认10，最大50
                                    pageNum: this.currPage, //	第几页	否	9	Number	默认1
                                    element: this,
                                    element2: followHeader,
                                };
                                this.currPage++;
                                getFollowDynamicList(obj);
                            }
                        }
                    }
                }, //结束 loadData
            },
            components:{
                'twitter-content': twitterComponent,
            },
            mounted:function(){
                this.$nextTick(function(){
                    // addLoad(this.loadData);

                });
            }
        });
    }


    //微博
    if(document.getElementById('blog-information')){
        var blogInfo = new Vue({
            el: '#blog-information',
            data:{
                currPage:1 ,
                pageSize:10,
                totalNum: 0,
                followList: [],
                largeImg: largeImg, //记录大图对象
                blogBlock: [],
            },
            components:{
                'blog-content': blogComponent,
            },
            methods:{
                loadData:function(){
                    // var sw = true;
                    if(getScrollTop() + window.innerHeight >= document.body.offsetHeight-50) {
                        if(this.totalNum > this.blogBlock.length) {
                            $('.loadData').removeClass('hidden');
                            var _this = this;
                            if (sw == true) {
                                sw = false;
                                var obj = {
                                    infoType: 2, //	资讯类型	是	2	Number	4 精选资讯 5 技术分析
                                    pageSize: this.pageSize, //	每页条数	否	9	Number	默认10，最大50
                                    pageNum: this.currPage, //	第几页	否	9	Number	默认1
                                    element: this,
                                    element2: followHeader,
                                };
                                this.currPage++;
                                getFollowDynamicList(obj);
                            }
                        }
                    }
                }, //结束 loadData
            },
            mounted:function(){
                this.$nextTick(function(){
                    // addLoad(this.loadData);

                });
            }
        });
    }


    //技术分析
    if(document.getElementById('skill-information')){
        var skillInfo = new Vue({
            el: '#skill-information',
            data:{
                currPage: 1,
                pageSize:10,
                totalNum: 0,
                followList: [],
                skillBlock: [],
            },
            components:{
                'skill-content': skillComponent,
            },
            methods:{
                loadData:function(){
                    // var sw = true;
                    if(getScrollTop() + window.innerHeight >= document.body.offsetHeight-50) {
                        if(this.totalNum > this.skillBlock.length){
                            $('.loadData').removeClass('hidden');
                            if(sw==true){
                                sw = false;
                                var obj = {
                                    infoType: 5, //	资讯类型	是	2	Number	4 精选资讯 5 技术分析
                                    pageSize: this.pageSize, //	每页条数	否	9	Number	默认10，最大50
                                    pageNum: this.currPage, //	第几页	否	9	Number	默认1
                                    element: this,
                                    element2: followHeader,
                                };
                                this.currPage++;
                                getFollowAiticlesList(obj);
                            }
                        }
                    }
                }, //结束 loadData
            },
            mounted:function(){
                this.$nextTick(function(){
                    // addLoad(this.loadData);

                });
            }
        });
    }



    //积分
    if(document.getElementById('my-int')){
        var  myInt= new Vue({
            el: '#info-list',
            data:{
                total: '0', //积分总数
                // intListNum : [], //
                regNum:'0', //注册数量
                recomNum:'0',   //推荐
                shareNum:'0', //分享
                signIn:'0' , //每日签到
                guesing:'0', //竞猜

                totalNum: -1,//总记录数
                currPage : 1, //当前页码
                pageSize: 10, //显示条数
                items:[   //表格数据
                ],
            },
            methods:{
                loadData:function(){
                    // var sw = true;
                    if(getScrollTop() + window.innerHeight >= document.body.offsetHeight-50) {
                        if(this.totalNum > this.items.length){
                            $('.loadData').removeClass('hidden');
                            if(sw==true){
                                sw = false;
                                //获取积分明细
                                this.currPage++;
                                getPointsList({pageSize:this.pageSize,pageNum:this.currPage,element: this});
                                $('.loadData').addClass('hidden');
                            }
                        }
                    }
                },
                goGainInt: function(){
                    location.href = 'personalGainInt.html';
                }
            },
            mounted: function(){
                //判断当前用户状态，登录 | 未登录
                if(isLogin()){
                    //暂无消息
                    $('.no-login').addClass('hidden');
                    showLeftMenu(true);

                    //左边菜单高度
                    $('#my-info').height(778);
                    //绑定滚动事件
                    addLoad(this.loadData);

                    //获取总览信息
                    getPointsSum({element: this});
                    //获取积分明细
                    getPointsList({pageSize:this.pageSize,pageNum:this.currPage,element: this});

                    personalMenuComponent.isThree = true;



                }else{
                    $('.no-login').removeClass('hidden');
                    //左边菜单高度
                    $('#my-info').height(566);

                    //个人信息
                    showLeftMenu(false);

                    this.total= 0; //积分总数
                    this.regNum = 0; //注册数量
                    this.recomNum= 0;   //推荐
                    this.shareNum=0; //分享
                    this.signIn= 0 ; //每日签到
                    this.guesing=0; //竞猜
                    this.items=[ ];  //表格数据
                }
            },
        });
    }



    // 设置资产提醒
    if(document.getElementById('warnPriceModal')){
        var priceWarn = new Vue({
            el:'#warnPriceModal',
            data:{
                name: "-" ,
                imgUrl: "",
                usd: "0",
                cny: "0",
                upNum:"",
                upPriceType:0,
                downNum:"",
                downPriceType:0,
                priceType:['元','美元'], //对应 list.type
                singleType:['空','上涨','下跌'],  //对应 list.single
                list:[  ],
            },
            methods:{
                cancelWarn:function(event){
                    //调用添加接口，结构执行成功，才执行以下内容
                    var index = event.currentTarget.getAttribute('value');
                    var obj ={
                        remindingId: this.list[index].id, //提醒ID
                        index: index, //删除的序列号
                        element: this,
                        myInfo: myInfo,
                        my: my,
                    };
                    removeRemindings(obj);
                },
                addWarn: function(event){
                    if($(event.currentTarget).hasClass('btn-active')){
                        var single = event.currentTarget.getAttribute('value');  // 1 上涨比例 2 下跌比例
                        switch (parseInt(single)) {
                            case 1:
                                var price = this.upNum;
                                var priceType = this.upPriceType;
                                break;
                            case 2:
                                var price = this.downNum;
                                var priceType = this.downPriceType;
                                break;
                            default:
                                var price = 0;
                                var priceType = 0;
                        }
                        if(parseFloat(price) > 0 ){
                            //调用添加接口，结构执行成功，才执行以下内容
                            var obj ={
                                remindingType: 1, //	预警类型	是	1	Number	0 币种 1 资产
                                remindingFlag: single,//	预警标志	是	1	Number	0 金额 1 上涨比例 2 下跌比例
                                remindingAmt: price,	//预警额度	是	18,6	Number
                                currency: priceType, //	单位	String	是	币种单位，0 人民币 1 美元
                                element: this,
                                myInfo: myInfo,
                                my: my,
                            };
                            addRemindings(obj);
                        }else{
                            $(event.currentTarget).parent().find('.warn-btn').removeClass('btn-active');
                            alert('输入有误');
                        }
                    }
                },
                //监测输入框数据是否符合规则，
                checkInput:function(event){
                    var strReg = /^[0-9]+.?[0-9]*$/g;
                    var value = $(event.currentTarget).parent().find('.price-input').val();
                    if(strReg.test(value)){
                        if(!$(event.currentTarget).parent().find('.warn-btn').hasClass('btn-active')){
                            $(event.currentTarget).parent().find('.warn-btn').addClass('btn-active');
                        }
                    }else{
                        // alert('失败');
                        $(event.currentTarget).parent().find('.warn-btn').removeClass('btn-active');
                    }

                }
            },
            watch:{

            }
        });
    }

    // 设置币种提醒
    if(document.getElementById('warnCurrencyModal')){
        var currencyWarn = new Vue({
            el:'#warnCurrencyModal',
            data:{
                imgUrl:"",
                symbol: "-" ,
                usd: "0",
                cny: "0",
                id: "",

                upNum:"",
                upPriceType:0,
                downNum:"",
                downPriceType:0,
                priceType:['元','美元'], //对应 list.type
                singleType:['空','上涨','下跌'],  //对应 list.single
                list:[],
            },
            methods:{
                cancelWarn:function(event){
                    //调用添加接口，结构执行成功，才执行以下内容
                    var index = event.currentTarget.getAttribute('value');
                    var obj ={
                        remindingId: this.list[index].id, //提醒ID
                        coinId: this.list[index].coinId, //货币ID
                        index: index, //删除的序列号
                        element: this,
                        myInfo: myInfo,
                        my: my,
                    };
                    removeRemindings(obj);

                },
                addWarn: function(event){
                    if($(event.currentTarget).hasClass('btn-active')){
                        var single = event.currentTarget.getAttribute('value');  // 1 上涨比例 2 下跌比例
                        var coinId = event.currentTarget.getAttribute('coinid');
                        switch (parseInt(single)) {
                            case 1:
                                var price = this.upNum;
                                var priceType = this.upPriceType;
                                break;
                            case 2:
                                var price = this.downNum;
                                var priceType = this.downPriceType;
                                break;
                            default:
                                var price = 0;
                                var priceType = 0;
                        }
                        if(parseFloat(price) > 0 ){
                            //调用添加接口，结构执行成功，才执行以下内容
                            var obj ={
                                remindingType: 0, //	预警类型	是	1	Number	0 币种 1 资产
                                remindingFlag: single,//	预警标志	是	1	Number	0 金额 1 上涨比例 2 下跌比例
                                remindingAmt: price,	//预警额度	是	18,6	Number
                                currency: priceType, //	单位	String	是	币种单位，0 人民币 1 美元
                                coinId: this.id, //币种ID
                                element: this,

                                myInfo: myInfo,
                                my: my,
                            };
                            addRemindings(obj);
                        }else{
                            $(event.currentTarget).parent().find('.warn-btn').removeClass('btn-active');
                            alert('输入有误');
                        }
                    }
                },
                //监测输入框数据是否符合规则，
                checkInput:function(event){
                    var strReg = /^[0-9]+.?[0-9]*$/g;
                    var value = $(event.currentTarget).parent().find('.price-input').val();
                    if(strReg.test(value)){
                        // alert('成功');
                        if(!$(event.currentTarget).parent().find('.warn-btn').hasClass('btn-active')){
                            $(event.currentTarget).parent().find('.warn-btn').addClass('btn-active');
                        }
                    }else{
                        // alert('失败');
                        $(event.currentTarget).parent().find('.warn-btn').removeClass('btn-active');
                    }

                }
            },
            watch:{

            }
        });
    }

    // 设置记一笔
    if(document.getElementById('recordModal')){
        var warn = new Vue({
            el:'#recordModal',
            data:{
                outSymbol:"",
                outCoinId: "",
                outCoinAmt: "",
                inSymbol:"",
                inCoinId: "",
                inCoinAmt: "",
                transPlace:"0",
                buyDate:"",
                transCode:"0",

                isOutSelect:false, //是否已经选择
                isInSelect:false, //是否已经选择

                outItems:[{id:1, symbol:'BTCX',name:"比特币X"}], //支出货币列表
                inItems:[{id:1, symbol:'BTCbtc',name:"比特币btc"}], //获取货币列表

                isBtnActive:false,  //保存按钮活动状态
            },
            methods:{
                //监测数量输入框数据是否符合规则，
                checkInput:function(event){
                    var strReg = /^[0-9]+.?[0-9]*$/g;
                    var value = $(event.currentTarget).parent().find('.price-input').val();
                    if(strReg.test(value)){
                        // alert('成功');
                        if(!$(event.currentTarget).parent().find('.warn-btn').hasClass('btn-active')){
                            $(event.currentTarget).parent().find('.warn-btn').addClass('btn-active');
                        }
                    }else{
                        // alert('失败');
                        $(event.currentTarget).parent().find('.warn-btn').removeClass('btn-active');
                    }
                },
                //选取币种
                selectCurrency:function(type,event){
                    $(event.currentTarget).parent().addClass('hidden');
                    switch (parseInt(type)) {
                        //0 支出   1 获得
                        case 0:
                            var index = event.currentTarget.getAttribute('value');
                            this.outCoinId = this.outItems[index].id;
                            this.outSymbol = this.outItems[index].symbol;
                            this.isOutSelect = true;
                            break;
                        case 1:
                            var index = event.currentTarget.getAttribute('value');
                            this.inCoinId = this.inItems[index].id;
                            this.inSymbol = this.inItems[index].symbol;
                            this.isInSelect = true;
                            break;
                    }
                },
                //更改选择框标志
                setSelectBox: function(type,event){
                    switch (parseInt(type)) {
                        //0 支出   1 获得
                        case 0:
                            this.isOutSelect = false;
                            break;
                        case 1:
                            this.isInSelect = false;
                            break;
                    }
                },
                //按钮激活
                activeBtn: function(){
                    if(this.outSymbol && this.outCoinAmt && this.inSymbol && this.inCoinAmt  && this.buyDate ){
                        this.isBtnActive = true;
                    }else{
                        this.isBtnActive = false;
                    }
                },
                //保存
                save: function(){
                    if(this.isBtnActive){
                        Vue.set(myInfo, 'list',[]);
                        var obj = {
                            transPlace: this.transPlace , //	交易场所	是	30	String
                            transTime: this.buyDate,//	交易时间	是	20	Number
                            transCode: this.transCode , //	交易类型	是	2	String
                            outCoinId: this.outCoinId,//	支出币种ID	是	30	String	CNY为人民币，其他为币种ID
                            outCoinSymbol: this.outSymbol,
                            outCoinAmt: this.outCoinAmt,//	支出币种数量	是	18, 6	Number
                            inCoinId: this.inCoinId,//	获得币种ID	是	30	String	CNY为人民币，其他为币种ID
                            inCoinAmt: this.inCoinAmt,//	获得币种数量	是	18, 6	Number
                            inCoinSymbol: this.inSymbol,

                            myInfo: myInfo,
                            my: my,
                        };
                        addTransRecords(obj);
                    }else{
                        $('.error-input-msg').removeClass('hidden');
                        setTimeout(function(){
                            $('.error-input-msg').addClass('hidden');
                        },2000);
                    }
                }
            },
            watch:{
                inCoinAmt:function(newVal,oldVal){
                    this.activeBtn();
                },
                outCoinAmt: function(newVal,oldVal){
                    this.activeBtn();
                },
                buyDate:function(newVal,oldVal){
                    this.activeBtn();
                },
                transPlace: function(newVal, oldVal){
                    this.activeBtn();
                    $('.get-currency').addClass('hidden');
                    if(newVal == "0"){
                        if(this.transCode == "0"){
                            //买入
                            this.outSymbol = 'CNY';
                            this.outCoinId = 'CNY';
                            this.inSymbol = "";

                            $('.out-coin-symbol').attr('readonly',true);
                            $('.in-coin-symbol').attr('readonly',false);
                        }else{
                            //卖出
                            this.inSymbol = 'CNY';
                            this.inCoinId = 'CNY';
                            this.outSymbol = "";
                            $('.out-coin-symbol').attr('readonly',false);
                            $('.in-coin-symbol').attr('readonly',true);
                        }
                    }else{
                        this.inSymbol = "";
                        this.outSymbol = "";
                        $('.out-coin-symbol').attr('readonly',false);
                        $('.in-coin-symbol').attr('readonly',false);
                    }
                },
                transCode:function(newVal, oldVal){
                    this.activeBtn();
                    $('.get-currency').addClass('hidden');
                    if(this.transPlace == "0"){

                        if(newVal == "0"){
                            //买入
                            this.outSymbol = 'CNY';
                            this.outCoinId = 'CNY';
                            this.inSymbol = "";
                            $('.out-coin-symbol').attr('readonly',true);
                            $('.in-coin-symbol').attr('readonly',false);
                        }else{
                           //卖出
                            this.inSymbol = 'CNY';
                            this.inCoinId = 'CNY'
                            this.outSymbol = "";
                            $('.out-coin-symbol').attr('readonly',false);
                            $('.in-coin-symbol').attr('readonly',true);
                        }
                    }else{
                        this.inSymbol = "";
                        this.outSymbol = "";
                        $('.out-coin-symbol').attr('readonly',false);
                        $('.in-coin-symbol').attr('readonly',false);
                    }

                },
                inSymbol:function(newVal, oldVal){
                    this.activeBtn();
                   if(newVal && !this.isInSelect){
                       if(newVal != oldVal && newVal != 'CNY'){
                           // $('.buy-info .right').find('.get-currency').removeClass('hidden');
                           //调用接口
                           if(getStrLength(newVal) >=2 ){
                               var data = {
                                   keyword: newVal,
                                   type: 1, // 支付 0    获得 0
                                   element: this,
                               };
                               filterCoins(data);
                           }else{

                               this.inItems = [];
                           }

                       }
                   }else{
                       $('.buy-info .right').find('.get-currency').addClass('hidden');
                   }
                },
                outSymbol:function(newVal, oldVal){
                    this.activeBtn();
                    if(newVal && !this.isOutSelect){
                        if(newVal != oldVal && newVal != 'CNY'){
                            if(getStrLength(newVal) >=2 ){
                                //调用接口
                                var data = {
                                    keyword: newVal,
                                    type: 0, // 支付 0    获得 0
                                    element: this,
                                };
                                filterCoins(data);
                            }else{
                                this.outItems = [];
                            }
                        }
                    }else{
                        $('.buy-info .left').find('.get-currency').addClass('hidden');
                    }
                },
            },
            mounted:function(){
                this.$nextTick(function(){
                    if(warn.transPlace == "0"){
                        if(warn.transCode == "0"){
                            //买入
                            warn.outSymbol = 'CNY';
                            warn.outCoinId = 'CNY';
                            warn.inSymbol = "";
                            $('.out-coin-symbol').attr('readonly',true);
                            $('.in-coin-symbol').attr('readonly',false);
                        }else{
                            //卖出
                            warn.inSymbol = 'CNY';
                            warn.inCoinId = 'CNY'
                            warn.outSymbol = "";
                            $('.out-coin-symbol').attr('readonly',false);
                            $('.in-coin-symbol').attr('readonly',true);
                        }
                    }
                });
            }
        });
    }


    //赚积分
    if(document.getElementById('gain-int')){
        //赚积分
        var  myGainInt= new Vue({
            el: '#gain-int',
            data:{ },
            methods:{
                isUserLogin:function(){
                    if(isLogin()){
                        return true;
                    }else{
                        return false;
                    }
                },
                //根据类型选择对应的分享方式
                toShareType:shareType,
                //鼠标移出关闭共享框
                closeShare: closeShare,
                //邀请用户
                getUserInt:function(event){
                    if(isLogin()){
                        showShare(event);
                        $.cookie('recommendPhone',$.cookie('phone'));
                    }else{
                        location.href = 'login.html';
                    }
                },
                //注册积分
                getRegisterInt:function(){
                    location.href = 'login.html';
                },

                //登录积分
                getLoginInt: function(){
                    location.href = 'login.html';
                },
                //分享积分
                getShareInt:function(){
                    location.href = 'information.html';
                },
                //竞猜积分
                getCurrencyInt: function(){
                    location.href = 'currency.html';
                },
            },
            mounted:function(){
            }
        });
    }


    //交易记录
    if(document.getElementById('record-list')){
        var  myRecord= new Vue({
            el: '#record-list',
            data:{
                totalNum: 0,
                currPage: 1,
                pageSize:10,
                addrType: ['场外交易','场内交易'],
                transType: ['买入','卖出'],
                items:[   ],//表格数据
            },
            methods:{
                removeRecord:function(){

                    if($('.cont-type .select-box:checked').length>0){
                        var left = ($(window).width()- 364)/2;
                        var top = ($(window).height()- 206)/2;
                        $('#removeModal').modal('show').css({
                            'margin-top':top,
                            'margin-left':left,
                            'width':364,
                            'height':206,
                        });
                    }else{
                        $('#warnMsg').find('span').text('请选择要删除的交易记录');
                        // $('#warnMsg').removeClass('hidden');
                        $('#warnMsg').fadeIn('slow');

                        setTimeout(function(){
                            $('#warnMsg').fadeOut('slow');
                        },2000);
                    }
                },
                loadData:function(){
                    // var sw = true;
                    if(getScrollTop() + window.innerHeight >= document.body.offsetHeight-50) {
                        if(this.totalNum > this.items.length){
                            $('.loadData').removeClass('hidden');
                            if(sw==true){
                                sw = false;
                                this.currPage++;
                                var obj = {
                                    pageSize: this.pageSize, //	每页条数	否	3	Number	默认10
                                    pageNum: this.currPage, //	第几页	否	3	Number	默认第一页
                                    element:myRecord ,
                                };
                                getTransRecords(obj);
                            }
                        }
                    }
                },
                selectBox:function(event){
                    $(event.currentTarget).parent().prop('checked');
                },
                selectAll: function(event){
                    if(event.currentTarget.getAttribute('value') == '1'){
                        $('tbody .select-box').prop("checked", false);
                        event.currentTarget.setAttribute('value',0);
                    }else{
                        $('tbody .select-box').prop("checked", true);
                        event.currentTarget.setAttribute('value',1);
                    }
                }
            },
            mounted:function(){
                this.$nextTick(function(){
                    if(isLogin()){
                        addLoad(this.loadData);
                        var obj = {
                            pageSize: this.pageSize, //	每页条数	否	3	Number	默认10
                            pageNum: this.currPage, //	第几页	否	3	Number	默认第一页
                            element:myRecord ,
                        };
                        getTransRecords(obj);
                    }

                    //计算提示框位置
                    var left = ($(window).width()- 342)/2;
                    var top = ($(window).height()- 60)/2;
                    $('#warnMsg').css({top: top, left: left,opacity:0.5055});
                    $('#warnMsg').fadeOut(0);
                });
            }
        });
    }



    //确认删除Modal
    if(document.getElementById('removeModal')){
        var delRecord = new Vue({
            el: '#removeModal',
            data:{},
            methods:{
                deleteRecord:function(){
                    var list = [];
                    var indexList = [];
                    var str = "";
                    for(var i=0; i<$('.cont-type .select-box').length; i++){
                        if($('.cont-type .select-box').eq(i).prop('checked')){
                            list.push(myRecord.items[i].id);
                            indexList.push(i);
                            str += myRecord.items[i].id+'&transRecordIds=';
                        }
                    }
                    if(indexList.length > 0){
                        var obj = {transRecordIds: list,};
                        removeTransRecords(obj);
                        for (var i = 0; i < list.length; i++) {
                            $('.cont-type .select-box').eq(i).parent().parent().addClass('hidden')
                        }
                        $('input:checked').prop('checked', false);
                    }
                    $('#removeModal').modal('hide');

                },
                cancel:function(){
                    $('#removeModal').modal('hide');
                }
            },
        });
    }


    //提醒记录
    if(document.getElementById('warn-list')){
        var  myWarn= new Vue({
            el: '#warn-list',
            data:{
                totalNum: 0,
                currPage: 1,
                pageSize:10,

                priceType:['元','美元'], //对应 list.type
                singleType:['空','上涨','下跌'],  //对应 list.single
                list:[   ],//表格数据
            },
            methods:{
                loadData:function(){
                    if(getScrollTop() + window.innerHeight >= document.body.offsetHeight-50) {
                        if(this.totalNum > this.list.length){
                            $('.loadData').removeClass('hidden');
                            if(sw==true){
                                sw = false;
                                this.currPage++;
                                var obj = {
                                    pageSize: this.pageSize, //	每页条数	否	3	Number	默认10
                                    pageNum: this.currPage, //	第几页	否	3	Number	默认第一页
                                    // remindingType: 1, //	提醒类型	否	1	Number	为空查询所有，0查询币种提醒，1 查询资产提醒
                                    element:this ,
                                };
                                getRemindingsList(obj)
                            }
                        }

                    }
                    // sw=true;
                },
                cancelWarn: function(event){
                    //调用添加接口，结构执行成功，才执行以下内容
                    var index = event.currentTarget.getAttribute('value');
                    var obj ={
                        remindingId: this.list[index].id, //提醒ID
                        index: index, //删除的序列号
                        element: this,

                        type: 1,  // 1表示记录列表页， 个人中心首页的记录列表仍需刷新资产详情
                    };
                    removeRemindings(obj);
                }
            },
            mounted:function(){
                this.$nextTick(function(){
                    if(isLogin()){
                        addLoad(this.loadData);

                        var obj = {
                            pageSize: this.pageSize, //	每页条数	否	3	Number	默认10
                            pageNum: this.currPage, //	第几页	否	3	Number	默认第一页
                            // remindingType: 1, //	提醒类型	否	1	Number	为空查询所有，0查询币种提醒，1 查询资产提醒
                            element:myWarn ,
                        };
                        getRemindingsList(obj);

                    }
                });
            }
        });
    }




});
